//参考链接：https://blog.csdn.net/weixin_38516688/article/details/105000087?utm_medium=distribute.pc_relevant.none-task-blog-2~default~baidujs_baidulandingword~default-0.no_search_link&spm=1001.2101.3001.4242.1
//终端npm run 执行 需要用户输入交互信息才继续执行
const inquire = require('inquirer')
const shell = require('shelljs')
const typeConfirm = () => {
    inquire.prompt([
        {
            name: 'confirm',
            type: 'confirm',
            message: '是否要继续执行',
            default: true,
        },
    ]).then(res => {
        console.log(`confirm:${res.confirm}`);
        if (res.confirm) {
            shell.exec(
                'npm run serve'
            )
        }
    })
}
typeConfirm()


